//
//  MYGHealthManagementEnums.swift
//  MYGrow
//
//  Created by 林矗 on 2024/3/9.
//

import Foundation

enum MYGHealthManagementType:String {
    case statistics
    case habit
    case history
    case report
    
    var index: Int {
        switch self {
        case .statistics:
            0
        case .habit:
            1
        case .history:
            2
        case .report:
            3
        }
    }
}


enum MYGHealthStatisticsType:String {
    case pressure
    case sugar
    case heart
    case bmi
    
    var index: Int {
        switch self {
        case .pressure:
            0
        case .sugar:
            1
        case .heart:
            2
        case .bmi:
            3
        }
    }
    
    var name: String {
        switch self {
        case .pressure:
            "血压"
        case .sugar:
            "血糖"
        case .heart:
            "心跳"
        case .bmi:
            "BMI"
        }
    }
}


enum MYGHealthManagementOP {
    case signleSelector
    case mutipleSelector
}

enum MYGHealthManagementLocalEventType: String {
    case smoke
    case drink
    case sleep
    case touch
    case ill
    case family
    case op
    case medical
    case allergy
    
    var name: String {
        switch self {
        case .smoke:
            "是否抽烟"
        case .drink:
            "是否饮酒"
        case .sleep:
            "每周睡眠不足6小时天数"
        case .touch:
            "危险因素接触史"
        case .ill:
            "疾病史"
        case .family:
            "家族史"
        case .op:
            "手术史"
        case .medical:
            "用药史"
        case .allergy:
            "过敏史"
        }
    }
    
    var index: Int {
        switch self {
        case .smoke:
            0
        case .drink:
            1
        case .sleep:
            2
        case .touch:
            0
        case .ill:
            1
        case .family:
            2
        case .op:
            3
        case .medical:
            4
        case .allergy:
            5
        }
    }
    
    var op: MYGHealthManagementOP {
        switch self {
        case .smoke, .drink, .sleep, .op:
            return .signleSelector
        case .touch, .ill, . family, .medical, .allergy:
            return .mutipleSelector
        }
    }
    
    var options: [String] {
        switch self {
        case .smoke, .drink, .op:
            return ["是", "否"]
        case .sleep:
            return ["0天", "1天", "2天", "3天", "4天", "5天", "6天", "7天"]
        case .touch:
            return ["无", "粉尘", "放射物质", "物理因素", "化学物质"]
        case .ill:
            return ["无", "糖尿病", "肥胖症", "高血压", "高血脂", "脂肪肝", "心脑血管病", "痛风", "甲状腺疾病", "呼吸系统疾病", "消化系统疾病", "乳腺疾病（女）", "肿瘤", "性功能障碍", "慢性前列腺炎", "男性不育", "男性生殖感染", "男性生殖器畸形", "中枢性性早熟（CPP）", "子宫内膜异位症（EM）", "前列腺癌（PC）", "其他"]
        case .family:
            return ["无", "糖尿病", "脑中风", "冠心病"]
        case .medical:
            return ["无", "降压药", "降糖药", "降脂药", "降尿酸药", "抗心率失常药", "缓解哮喘药", "其他"]
        case .allergy:
            return ["无", "阿司匹林过敏", "泛影葡胺过敏", "地卡因过敏", "头孢类抗生素过敏", "普鲁卡因过敏", "青霉素过敏", "维生素B1过敏", "磺胺类药物过敏", "其他"]
        }
    }
    
    func getContent(patient: MYGPatientModel) -> String {
        return ""
    }
    
    var content: String {
        return MYGHealthManager.shareManager.getHistoryItem(with: self).joined(separator: ",")
    }
}
